Skip to content

Conversation

silverwind
Copy link
Member

Fixes: #35314

tog

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 24, 2025
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Sep 24, 2025
@github-actions github-actions bot added modifies/translation modifies/templates This PR modifies the template files modifies/frontend and removed type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Sep 24, 2025
const wrapBtn = makeCodeBlockButton('code-wrap', 'material-wrap-text');
const wrap = getMarkupCodeWrap();
wrapBtn.setAttribute('data-active', String(wrap));
updateWrap(container, wrap);
Copy link
Member Author

@silverwind silverwind Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a flicker on page load, but I think it's okay for now. Moving the initial classes to backend will be more work and I don't know how to use the backend user setting storage.

@silverwind silverwind changed the title Add markdown code blog wrap toggle Add markdown code block wrap toggle Sep 25, 2025
@silverwind
Copy link
Member Author

silverwind commented Sep 25, 2025

I plan to do 2 more improvements:

  • Make all code blocks on the current page switch their wrapping mode when one is switched
  • Try to somehow sync the setting into the database for each user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend modifies/templates This PR modifies the template files modifies/translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Wrap text" button to inline code blocks

2 participants